package rad.framework.mda.properties;

import org.eclipse.swt.widgets.Event;


/**
 * Une implementation incomplete d'une section pour un field avec une valeur string property.
 * 
 * @author boudyacho
 */
public abstract class AbstractStringPropertySection extends AbstractTextPropertySection {

	/* (non-Javadoc)
	 * @see rad.framework.mda.properties.AbstractTextPropertySection#verifyField(org.eclipse.swt.widgets.Event)
	 */
	protected void verifyField(Event e) {
		// rien
	}

	/* (non-Javadoc)
	 * @see rad.framework.mda.properties.AbstractTextPropertySection#getFeatureAsString()
	 */
	protected String getFeatureAsString() {
		String string = getEObject() == null ? null : (String) getEObject()
				.eGet(getFeature());
		if (string == null) {
			return "";
		}
		return string;
	}


	/* (non-Javadoc)
	 * @see rad.framework.mda.properties.AbstractTextPropertySection#getNewFeatureValue(java.lang.String)
	 */
	protected Object getNewFeatureValue(String newText) {
		return newText;
	}


	/* (non-Javadoc)
	 * @see rad.framework.mda.properties.AbstractTextPropertySection#getOldFeatureValue()
	 */
	protected Object getOldFeatureValue() {
		return getFeatureAsString();
	}
}